<template>
  <router-view />
</template>

<script>
export default {
  props: {
    note: {
      type: Object,
      default: () => {}
    },
    notebook: {
      type: Object,
      default: () => {}
    }
  },
  name: 'content',
  data: function () {
    return {

    }
  },
  watch: {
    note: {
      handler: function (note) {
        this.note = note
        if (this.note && this.note.id) {
          this.toNoteContent()
        }
      },
      immediate: true
    },
    notebook: {
      handler: function (notebook) {
        this.notebook = notebook
        if (this.notebook && this.notebook.id) {
          this.toNoteContent()
        }
      },
      deep: true,
      immediate: true
    }
  },
  created () {
    // const that = this
    // window.addEventListener('scroll', function () {
    //   that.$store.state.fixedNav = (getScrollTop() || 0) > 50
    // })
  },
  methods: {
    toNoteContent: function () {
      const notebook = this.notebook
      this.$router.push({ path: '/content-note', query: { notebook_id: notebook.id } })
    }
  }
}
</script>

<style>

  .markdown-content{
    padding:15px 15px 15px 15px;
    background-color:#eaeaea;
  }

</style>
